local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.BaseComponent());
local CallBackManager = CommonOHOH.load.CallBackManager();

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
	self.car=self.parent
	self.player=self.parent.player
	self.CarInfoCtrl=self.player:GetComponent(_G.CommonOHOH.load.Common_CarInfoCtrl())



	CallBackManager:AddRbxConnect(self,self.CarInfoCtrl.UpdateEvent, function()
		self:UpdateSpeed()
		
	end);

	self:UpdateSpeed()
end;

--更新前进速度
function M.UpdateSpeed(self)
	--推进力
	local propulsion=self.CarInfoCtrl:GetPropulsion()
	print("当前车的推进力--->",propulsion)
	self.car:SetCarHumanoidSpeed(100)
end


function M.dtor(self)

	M.super.dtor(self);
end


return M